/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-03-27
 * Time: 19:53
 */

//创建一个学生类
//class Student {
//    public String name;//学生姓名
//    public int age;//学生年龄
//    public String sex;//学生性别
//    public double score;//学生分数
//
//    public void sleep() {
//        System.out.println("我要睡觉了！！！");
//    }
//    public void eat() {
//        System.out.println("我要干饭了！！！");
//    }
//    public void exam() {
//        System.out.println("我要考试了！！！");
//    }
//}
//
//public String getName() {
//        return name;
//        }
//
//public void setName(String name) {
//        this.name = name;
//        }
//
//public int getAge() {
//        return age;
//        }
//
//public void setAge(int age) {
//        this.age = age;
//        }
//
//public String getSex() {
//        return sex;
//        }
//
//public void setSex(String sex) {
//        this.sex = sex;
//        }
//
//public double getScore() {
//        return score;
//        }
//
//public void setScore(double score) {
//        this.score = score;
//        }
//
class Student {
    private String name;//学生姓名
    private int age;//学生年龄
    private String sex;//学生性别
    private double score;//学生分数

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }
    public void sleep() {
        System.out.println("我要睡觉了！！！");
    }
    public void eat() {
        System.out.println("我要干饭了！！！");
    }
    public void exam() {
        System.out.println("我要考试了！！！");
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                ", score=" + score +
                '}';
    }
    public Student(String name, int age, String sex, double score) {
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.score = score;
    }
}
public class TestDemo {

    public static void main(String[] args) {
        Student student = new Student("厚积薄发",18,"male",99.9);//利用new关键字实例化一个对象
        System.out.println(student);
//        student.setName("厚积薄发");
//        student.setAge(19);
//        student.setScore(99.9);
//        student.setSex("male");
//        System.out.println(student.getName());
//        System.out.println(student.getAge());
//        System.out.println(student.getScore());
//        System.out.println(student.getSex());
    }
}
